package de.android.learn;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class Startactivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    public boolean onCreateOptionsMenu(Menu menu){
    	getMenuInflater().inflate(R.menu.hauptmenu, menu);
    	return super.onCreateOptionsMenu(menu);
    }
    public boolean onOptionsItemSelected(MenuItem item){
    	switch(item.getItemId()){
    	case R.id.opt_beenden:
    		finish();
    		return true;
    	case R.id.opt_hilfe:
    		final Intent i = new Intent(this,HilfeActivity.class);
    		startActivity(i);
    		return true;
    	case R.id.opt_oeffnen:
    		final Intent in = new Intent(this,OeffnenActivity.class);
    		startActivity(in);
    		return true;
    	default:
    		return super.onOptionsItemSelected(item);
    	}
    }
    
}